<?php

// $filename = 'te_st.f.__a______ef...affa.eadja.png';

// $name = preg_replace('/(\.\w*$)/i', '', $filename);

// echo preg_replace('/(_+|\.+)/', ' ', $name);

// echo "</br>";

// $bname = str_replace(substr($filename, strrpos($filename, '.')), "", $filename);
// echo str_replace('_', ' ', $bname);

// echo "</br>";

// echo preg_match('/\.(png|jpg)$/i', $filename);

// echo $filename;

?>